package com.minelx.datamicroscope.core.display;

import com.minelx.datamicroscope.core.query.ResourceMapping;
import com.minelx.hellopandas.core.DataFrame;

import java.util.List;

public class TemplateProcessedMerger implements Merger {
	private final Merger merger;

	private final DisplayTemplates displayTemplates;

	public TemplateProcessedMerger(Merger merger, DisplayTemplates displayTemplates) {
		this.merger = merger;
		this.displayTemplates = displayTemplates;
	}

	@Override
	public DataFrame merge(List<ResourceMapping> files, String destinationURI) {
		displayTemplates.swap(files);
		return merger.merge(files, destinationURI);
	}
}
